<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once('c_manage.php');

class Log extends C_Manage {

	/**
	 * Index Page for this controller.
	 * map to /log/<method_name>
	 */
	public function index()
	{            
		$this->validate_login();
	
		$this->lang->load('log');
		$this->load->model('m_Log');
		
		$page = $this->uri->segment(3,0) * 1;
		if($page ==0)$page = 1;
		
		$pager = $this->m_Log->get_pager($this->page_size);
		$lst = $this->m_Log->select_list(null,'log_id desc', $this->page_size, ($page-1) * $this->page_size);
		
		$page_html = $this->create_pager_render('/log/index/',$pager['total'],$this->page_size);
		
		$data = array('lang'=> $this->lang->language,'list'=>$lst,'pager'=>$page_html);
		$this->load->view('inc_header',$data);
		$this->load->view('log_list',$data);
		$this->load->view('inc_footer');
	}		
}